package be.kuleuven.cs.mop.gui.logging;


import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;



/**
 * Forwards <code>LogRecord</code>s to a <code>LogList</code>
 * @author Ruben Feyen
 */
public class LogListHandler extends Handler {
	
	private final LogList list;
	
	
	public LogListHandler(final LogList list) {
		this.list = list;
		setLevel(Level.CONFIG);
	}
	
	
	
	@Override
	public final void close() throws SecurityException {}
	
	@Override
	public final void flush() {}
	
	@Override
	public final void publish(LogRecord record)	{ list.log(record);	}
	
}